home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 65.zip / BS1 part 65 / DevPac v3.02b.adf / include / devices / hardblocks.i < prev    next >
Text File  |  1991-11-20  |  9KB  |  196 lines

  1.     IFND    DEVICES_HARDBLOCKS_I
  2. DEVICES_HARDBLOCKS_I    SET    1
  3. **
  4. **    $Filename: devices/hardblocks.i $
  5. **    $Revision: 1.0 $
  6. **    $Date: 88/07/11 15:32:58 $
  7. **
  8. **    File System identifier blocks for hard disks
  9. **
  10. **    (C) Copyright 1988 Commodore-Amiga, Inc.
  11. **        All Rights Reserved
  12. **
  13.  
  14. ;---------------------------------------------------------------------
  15. ;
  16. ;    This file describes blocks of data that exist on a hard disk
  17. ;    to describe that disk.  They are not generically accessable to
  18. ;    the user as they do not appear on any DOS drive.  The blocks
  19. ;    are tagged with a unique identifier, checksummed, and linked
  20. ;    together.  The root of these blocks is the RigidDiskBlock.
  21. ;
  22. ;    The RigidDiskBlock must exist on the disk within the first
  23. ;    RDB_LOCATION_LIMIT blocks.  This inhibits the use of the zero
  24. ;    cylinder in an AmigaDOS partition: although it is strictly
  25. ;    possible to store the RigidDiskBlock data in the reserved
  26. ;    area of a partition, this practice is discouraged since the
  27. ;    reserved blocks of a partition are overwritten by "Format",
  28. ;    "Install", "DiskCopy", etc.  The recommended disk layout,
  29. ;    then, is to use the first cylinder(s) to store all the drive
  30. ;    data specified by these blocks: i.e. partition descriptions,
  31. ;    file system load images, drive bad block maps, spare blocks,
  32. ;    etc.
  33. ;
  34. ;    Though only 512 byte blocks are currently supported by the
  35. ;    file system, this proposal tries to be forward-looking by
  36. ;    making the block size explicit, and by using only the first
  37. ;    256 bytes for all blocks but the LoadSeg data.
  38. ;
  39. ;---------------------------------------------------------------------
  40.  
  41. ;
  42. ;   NOTE
  43. ;    optional block addresses below contain $ffffffff to indicate
  44. ;    a NULL address
  45. ;
  46.  STRUCTURE    RigidDiskBlock,0
  47.     ULONG   rdb_ID        ; 4 character identifier
  48.     ULONG   rdb_SummedLongs    ; size of this checksummed structure
  49.     LONG    rdb_ChkSum        ; block checksum (longword sum to zero)
  50.     ULONG   rdb_HostID        ; SCSI Target ID of host
  51.     ULONG   rdb_BlockBytes    ; size of disk blocks
  52.     ULONG   rdb_Flags        ; see below for defines
  53.     ; block list heads
  54.     ULONG   rdb_BadBlockList    ; optional bad block list
  55.     ULONG   rdb_PartitionList    ; optional first partition block
  56.     ULONG   rdb_FileSysHeaderList ; optional fule system header block
  57.     ULONG   rdb_DriveInit    ; optional drive-specific init code
  58.                 ; DriveInit(lun,rdb,ior): "C" stk & d0/a0/a1
  59.     STRUCT  rdb_Reserved1,6*4    ; set to $ffffffff
  60.     ; physical drive characteristics
  61.     ULONG   rdb_Cylinders    ; number of drive cylinders
  62.     ULONG   rdb_Sectors        ; sectors per track
  63.     ULONG   rdb_Heads        ; number of drive heads
  64.     ULONG   rdb_Interleave    ; interleave
  65.     ULONG   rdb_Park        ; landing zone cylinder
  66.     STRUCT  rdb_Reserved2,3*4
  67.     ULONG   rdb_WritePreComp    ; starting cylinder: write precompensation
  68.     ULONG   rdb_ReducedWrite    ; starting cylinder: reduced write current
  69.     ULONG   rdb_StepRate    ; drive step rate
  70.     STRUCT  rdb_Reserved3,5*4
  71.     ; logical drive characteristics
  72.     ULONG   rdb_RDBBlocksLo    ; low block of range reserved for hardblocks
  73.     ULONG   rdb_RDBBlocksHi    ; high block of range for these hardblocks
  74.     ULONG   rdb_LoCylinder    ; low cylinder of partitionable disk area
  75.     ULONG   rdb_HiCylinder    ; high cylinder of partitionable data area
  76.     ULONG   rdb_CylBlocks    ; number of blocks available per cylinder
  77.     ULONG   rdb_AutoParkSeconds    ; zero for no auto park
  78.     STRUCT  rdb_Reserved4,2*4
  79.     ; drive identification
  80.     STRUCT  rdb_DiskVendor,8
  81.     STRUCT  rdb_DiskProduct,16
  82.     STRUCT  rdb_DiskRevision,4
  83.     STRUCT  rdb_ControllerVendor,8
  84.     STRUCT  rdb_ControllerProduct,16
  85.     STRUCT  rdb_ControllerRevision,4
  86.     STRUCT  rdb_Reserved5,10*4
  87.  
  88.     LABEL   RigidDiskBlock_SIZEOF
  89.  
  90. IDNAME_RIGIDDISK    EQU    (('R'<<24)!('D'<<16)!('S'<<8)!('K'))
  91.  
  92. RDB_LOCATION_LIMIT    EQU    16
  93.  
  94.     BITDEF  RDBF,LAST,0        ; no disks exist to be configured after
  95.                 ;   this one on this controller
  96.     BITDEF  RDBF,LASTLUN,1    ; no LUNs exist to be configured greater
  97.                 ;   than this one at this SCSI Target ID
  98.     BITDEF  RDBF,LASTTID,2    ; no Target IDs exist to be configured
  99.                 ;   greater than this one on this SCSI bus
  100.     BITDEF  RDBF,NORESELECT,3    ; don't bother trying to perform reselection
  101.                 ;   when talking to this drive
  102.     BITDEF  RDBF,DISKID,4    ; rdb_Disk... identification valid
  103.     BITDEF  RDBF,CTRLRID,5    ; rdb_Controller... identification valid
  104.  
  105.  
  106. ;---------------------------------------------------------------------
  107.  STRUCTURE    BadBlockEntry,0
  108.     ULONG   bbe_BadBlock    ; block number of bad block 
  109.     ULONG   bbe_GoodBlock    ; block number of replacement block  
  110.     LABEL   BadBlockEntry_SIZEOF
  111.  
  112.  STRUCTURE    BadBlockBlock,0
  113.     ULONG   bbb_ID        ; 4 character identifier
  114.     ULONG   bbb_SummedLongs    ; size of this checksummed structure
  115.     LONG    bbb_ChkSum        ; block checksum (longword sum to zero)
  116.     ULONG   bbb_HostID        ; SCSI Target ID of host
  117.     ULONG   bbb_Next        ; block number of the next BadBlockBlock
  118.     ULONG   bbb_Reserved
  119.     STRUCT  bbb_BlockPairs,61*BadBlockEntry_SIZEOF ; bad block entry pairs
  120.     ; note 61 assumes 512 byte blocks
  121.     ; there is no BadBlockBlock_SIZEOF: try rdb_BlockBytes
  122.  
  123. IDNAME_BADBLOCK        EQU    (('B'<<24)!('A'<<16)!('D'<<8)!('B'))
  124.  
  125. ;---------------------------------------------------------------------
  126.  STRUCTURE    PartitionBlock,0
  127.     ULONG   pb_ID        ; 4 character identifier
  128.     ULONG   pb_SummedLongs    ; size of this checksummed structure
  129.     LONG    pb_ChkSum        ; block checksum (longword sum to zero)
  130.     ULONG   pb_HostID        ; SCSI Target ID of host
  131.     ULONG   pb_Next        ; block number of the next PartitionBlock
  132.     ULONG   pb_Flags        ; see below for defines
  133.     STRUCT  pb_Reserved1,2*4
  134.     ULONG   pb_DevFlags        ; preferred flags for OpenDevice
  135.     STRUCT  pb_DriveName,32    ; preferred DOS device name: BSTR form
  136.                 ; (not used if this name is in use)
  137.     STRUCT  pb_Reserved2,15*4    ; filler to 32 longwords
  138.     STRUCT  pb_Environment,17*4    ; environment vector for this partition
  139.     STRUCT  pb_EReserved,15*4    ; reserved for future environment vector
  140.     LABEL   PartitionBlock_SIZEOF
  141.  
  142. IDNAME_PARTITION    EQU    (('P'<<24)!('A'<<16)!('R'<<8)!('T'))
  143.  
  144.     BITDEF  PBF,BOOTABLE,0    ; this partition is intended to be bootable
  145.                 ;   (expected directories and files exist)
  146.     BITDEF  PBF,NOMOUNT,1    ; do not mount this partition (e.g. manually
  147.                 ;   mounted, but space reserved here)
  148.  
  149. ;---------------------------------------------------------------------
  150.  STRUCTURE    FileSysHeaderBlock,0
  151.     ULONG   fhb_ID        ; 4 character identifier
  152.     ULONG   fhb_SummedLongs    ; size of this checksummed structure
  153.     LONG    fhb_ChkSum        ; block checksum (longword sum to zero)
  154.     ULONG   fhb_HostID        ; SCSI Target ID of host
  155.     ULONG   fhb_Next        ; block number of the next FileSysHeaderBlock
  156.     ULONG   fhb_Flags        ; see below for defines
  157.     STRUCT  fhb_Reserved1,2*4
  158.     ULONG   fhb_DosType        ; file system description: match this with
  159.                 ; partition environment's DE_DOSTYPE entry 
  160.     ULONG   fhb_Version        ; release version of this code
  161.     ULONG   fhb_PatchFlags    ; bits set for those of the following that
  162.                 ;   need to be substituted into a standard
  163.                 ;   device node for this file system: e.g.
  164.                 ;   $180 to substitute SegList & GlobalVec
  165.     ULONG   fhb_Type        ; device node type: zero
  166.     ULONG   fhb_Task        ; standard dos "task" field: zero
  167.     ULONG   fhb_Lock        ; not used for devices: zero
  168.     ULONG   fhb_Handler        ; filename to loadseg: zero placeholder
  169.     ULONG   fhb_StackSize    ; stacksize to use when starting task
  170.     LONG    fhb_Priority    ; task priority when starting task
  171.     LONG    fhb_Startup        ; startup msg: zero placeholder
  172.     LONG    fhb_SegListBlocks    ; first of linked list of LoadSegBlocks:
  173.                 ;   note that this entry requires some
  174.                 ;   processing before substitution
  175.     LONG    fhb_GlobalVec    ; BCPL global vector when starting task
  176.     STRUCT  fhb_Reserved2,23*4    ; (those reserved by PatchFlags)
  177.     STRUCT  fhb_Reserved3,21*4
  178.     LABEL   FileSysHeader_SIZEOF
  179.  
  180. IDNAME_FILESYSHEADER    EQU    (('F'<<24)!('S'<<16)!('H'<<8)!('D'))
  181.  
  182. ;---------------------------------------------------------------------
  183.  STRUCTURE    LoadSegBlock,0
  184.     ULONG   lsb_ID        ; 4 character identifier
  185.     ULONG   lsb_SummedLongs    ; size of this checksummed structure
  186.     LONG    lsb_ChkSum        ; block checksum (longword sum to zero)
  187.     ULONG   lsb_HostID        ; SCSI Target ID of host
  188.     ULONG   lsb_Next        ; block number of the next FileSysBlock
  189.     STRUCT  lsb_LoadData,123*4    ; data for "loadseg"
  190.     ; note 123 assumes 512 byte blocks
  191.     ; there is no LoadSegBlock_SIZEOF: try rdb_BlockBytes
  192.  
  193. IDNAME_LOADSEG        EQU    (('L'<<24)!('S'<<16)!('E'<<8)!('G'))
  194.  
  195.     ENDC
  196.